import 'package:flutter/material.dart';
import 'package:flutter_basic/basic/basic_view.dart';
import 'controller.dart';

class HomePage extends BasicPage<HomeController>{
  HomePage.bind(controller, {String? tag}) : super.bind(controller, tag: tag);


  Widget build(BuildContext context) {
    print('build-build:${this.runtimeType}');
    return Scaffold(
      body: Container(
        child: PageView.builder(
          physics: NeverScrollableScrollPhysics(),
          itemBuilder: (context, index){
            return controller.pages(viewTag)[index];
          },
          controller: controller.pageController,
          onPageChanged: (index){
            controller.currentPage = index;
          },
          itemCount: controller.pages(viewTag).length,
        ),
      ),
    );
  }
}
